package cn.com.pansky.action.policy;

import java.util.ArrayList;
import java.util.List;

import net.vsame.url2sql.action.CommonAction;
import net.vsame.url2sql.utils.PostParam;
import cn.com.pansky.helper.PostHelper;

import com.alibaba.fastjson.JSONObject;

public class PolicyAction extends CommonAction{

	public void getPolicy() {
		String appId = getParam("appId");
		if(context.hasError()) {
			return;
		}
		List<PostParam> params = new ArrayList<PostParam>();
		params.add(new PostParam("appId" , "string", appId));
		JSONObject obj = PostHelper.send("policy/page.json", params);
		handleResult(obj);
		context.put("result", obj.get("result"));
	}
	
	public void getContent() {
		String contentId = getParam("contentId");
		if(context.hasError()) {
			return;
		}
		List<PostParam> params = new ArrayList<PostParam>();
		params.add(new PostParam("id" , "string", contentId));
		JSONObject obj = PostHelper.send("policy/getContent.json", params);
		handleResult(obj);
		context.put("result", obj.get("result"));
	}
}
